// 导入 applyMiddleware 来应用异步方法
import {
  legacy_createStore as createStore,
  combineReducers,
  applyMiddleware,
} from "redux";

// 导入模块 thunk
import { thunk } from "redux-thunk";

import app from "./modules/app";
import pro from "./modules/pro";

//把两个 reducer 合并成一个 combineReducers
const reducer = combineReducers({
  app,
  pro,
});

//应用异步模块 applyMiddleware(thunk)
const store = createStore(reducer, applyMiddleware(thunk));

export default store;
